﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="config.aspx.cs" Inherits="UI.system.page.config.config" %>
<%@ Import Namespace="Common" %>
<script src="/js/jquery.min.js"></script>
<script src="/js/common.js"></script>
<script src="/js/md5.js"></script>
<script src="/js/swfupload.js"></script>
<script src="/system/js/admin.js"></script>
<script src="/system/layui/layui.js"></script>
<link rel="stylesheet" href="/system/layui/css/layui.css">
<link rel="stylesheet" href="/system/css/iframe.css">
<div style="margin: 35px;">
	<form class="layui-form" style="padding-left:0px;">
        <div class="layui-form-item">
			<label class="layui-form-label">Logo</label>
			<div class="layui-input-block" style="width:300px;">
                <div id="upload_products1" class='upload_product <%=string.IsNullOrEmpty(info.Logo)?"":"hidden" %>'><div id="upload_img"></div></div>
                 <div id="upload_show1" class='upload_show <%=string.IsNullOrEmpty(info.Logo)?"hidden":"" %>'>
                     <div id="img_container1" class="img_container" src="<%=info.Logo %>"><img src="<%=info.Logo %>"/></div>
                     <div class="reupload"><a href="javascript:Re_Upload1()">重传</a></div>
                 </div> <div style="float:left; color:red; padding-top:5px; font-size:12px; padding-left:10px;"></div>
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">系统名称</label>
			<div class="layui-input-block" style="width:300px;">
				<input id="webname" placeholder="请输入系统名称" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.WebName%>">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">网站标题</label>
			<div class="layui-input-block" style="width:300px;">
				<input id="title" placeholder="请输入网站标题" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.Title%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">网站关键词</label>
			<div class="layui-input-block" style="width:300px;">
				<input id="keyword" placeholder="请输入网站关键词" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.Keyword%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label">网站描述</label>
			<div class="layui-input-block" style="width:300px;">
				<input id="description" placeholder="请输入网站描述" lay-verify="required" autocomplete="off" class="layui-input" value="<%=info.Description%>">
			</div>
		</div>
        <div class="layui-form-item">
			<label class="layui-form-label"></label>
			<div class="layui-input-inline">
				<a lay-filter="save" class="layui-btn layui-btn-small" onclick="Update_Config()">保存</a>
			</div>
		</div>
	</form>
</div>
<script>
    function Update_Config() {
        var data = {};
        data.act = "Update_Config";
        data.logo = $("#img_container1 img").attr("src");
        data.title = $("#title").val();
        data.webname = $("#webname").val();
        data.keyword = $("#keyword").val();
        data.description = $("#description").val();
        data.sign = GetSign(data.act);
        LayerBox.Loading();
        Ajax.Post("/tools/Admin.ashx", data, function (r) {
            LayerBox.Close.ByAll();
            var json = $.parseJSON(r);
            if (json.state) {
                LayerBox.Success("保存成功");
            }
            else {
                LayerBox.Error(json.msg);
            }
        });
    };

    var upload = new Upload_File("upload_img");
    upload.swfu.handle = "upload_img";
</script>